package mhwi.actions;

import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import mhwi.helper.ModHelper;
import mhwi.powers.BaiRenPower;
import mhwi.powers.HuangRenPower;
import mhwi.powers.HongRenPower;

public class ApplyKaiRenPowerAction extends AbstractGameAction {
    private AbstractPlayer p;

    public ApplyKaiRenPowerAction(AbstractPlayer p) {
        this.p = p;
    }

    @Override
    public void update() {
        if (ModHelper.hasPowers(BaiRenPower.POWER_ID)) {
            addToTop(new ApplyPowerAction(p, p, new HuangRenPower(p), 2));
        } else if (ModHelper.hasPowers(HuangRenPower.POWER_ID)) {
            addToTop(new ApplyPowerAction(p, p, new HongRenPower(p), 2));
        } else if (ModHelper.hasPowers(HongRenPower.POWER_ID)) {
            addToTop(new ApplyPowerAction(p, p, new HongRenPower(p), 2));
        } else {
            addToTop(new ApplyPowerAction(p, p, new BaiRenPower(p), 2));
        }
        this.isDone = true;
    }
}